package com.jt.system.mapper;

import com.jt.system.pojo.User;
import org.apache.ibatis.session.SqlSession;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public class UserMapperImpl implements UserMapper {

    @Autowired
    private SqlSession sqlSession;
    @Override
    public User selectUserByUsername(String username) {
        String sql = "select id,username,password,status from tb_users where username = #{username}";
        User user = sqlSession.selectOne(sql, "admin");
        return user;
    }//SqlSession-->Executor(CachingExecutor)-->Connection-->PreparedStatement-->ResultSet

    @Override
    public List<String> doSelectUserPermissions(Long userId) {
        return null;
    }
}
